package HomeWork.Work_01;

import java.util.Scanner;
/**
 * 判断一个素数能被几个9整除
 */
public class PrimeNumber_02 {
    public static void main(String[] args) {
        prime();
    }
    public static void prime() {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入素数：");
        int n = sc.nextInt();
        int sum = 9,i = 1;
        while (sum % n != 0) {
            sum = sum * 10 + 9;
            i++;
        }
        System.out.println("素数" + n + "能整除" + i + "个9组成的数" + sum);
    }
}
